'use strict'

const pg=require('pg')
let psql=new pg.Pool({
    database:'kejinghua',
    user:'kejinghua',
    port:5432,
    host:'127.0.0.1',
    password:'kejinghua',
    max:5
})

;(async()=>{
    let tm=Date.now()
    //随机数字转出16进制并去掉前两位
    let id=`${Math.random().toString(16).substring(2)}`
    let sqltext=`INSERT INTO`
        +` content(id,detail,title,update_time)`
        +` VALUES($1,$2,$3,$4,$5)`
})
let r =await psql.query(sqltext,[
    id, `测试内容:${Math.random()}`,'test',
    tm,tm
])